package cn.edu.scau.cmi.houzhicong.singletonPattern.domain;

import java.util.HashSet;

public class MultiChairMan {

	private static HashSet<MultiChairMan> ChairManSet = new HashSet<MultiChairMan>();
	private static int maxSize = 5;
	private String id;

	public String getId() {
		return id;
	}

	private MultiChairMan(String id){
		this.id = id;
	}


	public static MultiChairMan addMultiChairMan(String id){
		MultiChairMan multiChairMan = null;
		if(ChairManSet.size()<maxSize){
			multiChairMan = new MultiChairMan(id);
			ChairManSet.add(multiChairMan);
		}
		return multiChairMan;
	}
}
